package tbdp.tool.common;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author xbkaishui
 * @version $Id: Record.java, v 0.1 2017-06-18 下午12:17 xbkaishui Exp $$
 */
public class Record {

    private Map<String, Object> data = new LinkedHashMap<String, Object>();

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }

    public void put(String key, Object val) {
        data.put(key, val);
    }

    public Object get(String key) {
        return data.get(key);
    }

    public String getString(String key, String def) {
        Object val = get(key);
        if (val == null) {
            return def;
        }
        return val.toString();
    }


    @Override
    public String toString() {
        return "Record [data=" + data + "]";
    }
}
